﻿/// <reference path="BaseTextNode.js" />
/// <reference path="TreeNodeType.js" />

var $ExpansionNode = TA.Turbo.Controls.ExpansionNode = function ExpansionNode()
{
	this.BaseTextNode();
}
$ExpansionNode.Inherit($BaseTextNode);

var ____a;
if (____a)
{
	$ExpansionNode.prototype = new $BaseTextNode();
	$ExpansionNode.prototype.BaseTextNode = new $BaseTextNode();
}

$ExpansionNode.prototype._anchor = null;

$ExpansionNode.prototype.get_Type = function get_Type()
{
	return TreeNodeType.Expansion;
}

$ExpansionNode.prototype.SerializeContents = function SerializeContents(jw)
{
	this.BaseTextNode.SerializeContents.call(this, jw);
}
$ExpansionNode.prototype.DeserializeContent = function DeserializeContent(propShortName, value)
{
	switch (propShortName)
	{
		default: this.BaseTextNode.DeserializeContent.call(this, propShortName, value); break;
	}
}
$ExpansionNode.prototype._CreateContent = function _CreateContent()
{
	this._anchor = document.createElement("A");
	this._anchor.AddEvent("click", this._anchor_Click, this);
	this._anchor.innerHTML = this.Text;

	this.get_DivContent().appendChild(this._anchor);
}
$ExpansionNode.prototype._ParseContent = function _ParseContent()
{
	this._anchor = this.get_DivContent().FindFirstChild("A");
	this._anchor.AddEvent("click", this._anchor_Click, this);
}
$ExpansionNode.prototype._anchor_Click = function _anchor_Click(e)
{
	this.ExpandCollapse();
	Events.Cancel(e);
}
